<!doctype html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../css/mui.css" rel="stylesheet" />
		<link href="../css/iconfont.css" rel="stylesheet" />
    	<link href="../css/chazhao.css" rel="stylesheet" />
    	<script src="../js/jquery-1.9.1.min.js"></script>
	</head>
	<body>
		<!--  主题内容组件     -->
		<div class="mui-content">
		    <!-- 扫描、分类、品牌   -->
		    <div id="three">
		    	<ul id="three_ul"></ul>
		    </div>
			<!-- 热门分类模块   -->
			<div class="gongneng">
				<p class="title">热门分类</p>
				<ul id="gongneng_ul"></ul>
			</div>
			<!-- 品牌分类模块   -->
			<div class="pinpai">
				<p class="title">品牌分类</p>
				<ul id="pinpai_ul">
					<!--<a><li>
						<img src="../img/index/pin1.jpg">
					</li></a>
					<a><li>
						<img src="../img/index/pin2.jpg">
					</li></a>
					<a><li>
						<img src="../img/index/pin3.jpg">
					</li></a>
					<a><li class="rem_right">
						<img src="../img/index/pin4.jpg">
					</li></a>
					<a><li>
						<img src="../img/index/pin1.jpg">
					</li></a>
					<a><li>
						<img src="../img/index/pin3.jpg">
					</li></a>
					<a><li>
						<img src="../img/index/pin3.jpg">
					</li></a>
					<a><li class="rem_right">
						<img src="../img/index/pin4.jpg">
					</li></a>-->
				</ul>
			</div>
		</div>
		<script src="../js/mui.js" type="text/javascript" charset="utf-8"></script>
		<script src="../js/go.js"></script>
		<script type="text/javascript">
			mui.init();
//			mui.plusReady(function(){
//				mui("#three_ul").on('tap',"#ul_one",function(){
//					mui.openWindow({
//						url:"wuliuxinxi.html",
//						id:"wuliuxinxi.html"
//					})
//				});
//			})
		</script>
		<script type="text/javascript">
			var programmer1=[{
				"s_word":"扫描",
				"s_class":"iconfont icon-saomianerweima",
				"s_href":"wuliuxinxi.html",
				"id":"ul_one"
			},{
				"s_word":"分类",
				"s_class":"iconfont icon-fenlei",
				"s_href":"quanbu.html",
				"id":"ul_two"
			},{
				"s_word":"品牌",
				"s_class":"iconfont icon-pinpai",
				"s_href":"quanbupinpai.html",
				"id":"ul_thire"
			}]
			var html1='';
			for(var i=0,len=programmer1.length;i<len;i++){
				html1 += '<li data-href=' + programmer1[i].s_href + ' class="lis" id=' + programmer1[i].id + '><a href="####">\
					<i class="'+ programmer1[i].s_class +'">\
					</i>\
					<span> '+ programmer1[i].s_word +' </span>\
				<a/></li>'
			};
            $.ajax({
                url:'http://www.reliants.cn/Mobile/index/chazhaoFeilei',
                type:'get',
                async:true,
                dataType:'html',
                success:function(data){
                    var a4 = $('<a><li><img src="../img/index/gn4.jpg"><p>更多</p></li></a>')
                    $("#gongneng_ul").html(data);
                    $(a4).appendTo("#gongneng_ul");
                    var fenlei_img = document.getElementById('gongneng_ul').getElementsByTagName('li');
                    for(var i=0;i<fenlei_img.length;i++){
                        (function(x){
                            fenlei_img[x].addEventListener('tap',function(){
                                if(x<7){
									var product_id = this.getElementsByTagName('p')[0].getAttribute('data-id');
									var title=$(this).find("p").text();
									mui.openWindow({
										url:"changpinlist.html",
										id:"changpinlist.html",
										waiting: {
											autoShow: false
										},
										extras: {
											urlid:product_id,
											title:title
										}
									})
								}else{
									mui.openWindow({
										url:"quanbu.html",
										id:"quanbu.html",
										waiting: {
											autoShow: false
										},
										extras: {
											urlid:product_id,
											title:title
										}
									})
								}
                            });
                            
                        })(i)
                    }
                },
                error:function(XMLHttpRequest, textStatus, errorThrown){
                    alert(errorThrown)
                },
            })
			var programmer3=[{
				"g_src":"../img/index/pin1.jpg",
				"g_href":"http://www.baidu.com"
			},{
				"g_src":"../img/index/pin2.jpg",
				"g_href":"http://www.baidu.com"
			},{
				"g_src":"../img/index/pin3.jpg",
				"g_href":"http://www.baidu.com"
			},{
				"g_src":"../img/index/pin4.jpg",
				"g_href":"http://www.baidu.com"
			},{
				"g_src":"../img/index/pin1.jpg",
				"g_href":"http://www.baidu.com"
			},{
				"g_src":"../img/index/pin2.jpg",
				"g_href":"http://www.baidu.com"
			},{
				"g_src":"../img/index/pin3.jpg",
				"g_href":"http://www.baidu.com"
			},{
				"g_src":"../img/index/pin4.jpg",
				"g_href":"http://www.baidu.com"
			}]
			var html3='';
			var aaa='';
			for(var i=0,len=programmer3.length;i<len;i++){
				html3 += '<li class="list_url" data-href=' + programmer3[i].g_href + '><a href="####">\
					<img src="' + programmer3[i].g_src + '"></img>\
				</a></li>';
			}
			$('#three_ul').html(html1);
			$('#pinpai_ul').html(html3);
			$('#pinpai_ul li').eq(3).addClass("rem_right");
			$('#pinpai_ul li').eq(-1).addClass("rem_right");
			mui.plusReady(function() {
				gotoShopDetail();
				gotopage();
				//外链点击
				function gotoShopDetail() {
					var list = document.getElementsByClassName("list_url");
					var urlid = "";
					for (var i = 0, len = list.length; i < len; i++) {
						list[i].addEventListener("tap", function() {
							urlid = this.getAttribute("data-href");
							mui.openWindow({
								url: "bpage.html",
								id: "bpage.html",
								waiting: {
									autoShow: true
								},
								extras: {
									urlid: urlid
								}
							});
						});
					}
				}
				//扫描、分类、品牌点击
				function gotopage() {
					var list = document.getElementsByClassName("lis");
					var urlid = "";
					for (var i = 0, len = list.length; i < len; i++) {
						list[i].addEventListener("tap", function() {
							urlid = this.getAttribute("data-href");
							mui.openWindow({
								url: urlid,
								id: urlid,
								waiting: {
									autoShow: false
								},
								extras: {
									urlid: urlid
								}
							});
						});
					}
				}
			})
		</script>
	</body>

</html>